package com.aipp.mall.h5.domain.entity;

import com.aipp.mall.common.anno.Note;
import com.aipp.mall.common.model.BaseAudit;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serial;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 订单表对象 oms_order
 *
 * @author zcc
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("oms_order")
public class Order extends BaseAudit implements Serializable {

    @Serial
    private static final long serialVersionUID = 8408983782164610411L;

    @Note("订单id")
    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    @Note("支付id")
    private Long payId;

    @Note("订单编号")
    private String orderSn;

    @Note("MEMBER_ID")
    private Long memberId;

    @Note("用户帐号")
    private String memberUsername;

    @Note("订单总金额")
    private BigDecimal totalAmount;

    @Note("采购价")
    private BigDecimal purchasePrice;

    @Note("应付金额（实际支付金额）")
    private BigDecimal payAmount;

    @Note("运费金额")
    private BigDecimal freightAmount;

    @Note("支付方式：0->未支付；1->支付宝；2->微信")
    private Integer payType;

    @Note("订单状态：0->待付款；1->待发货；2->已发货；3->已完成；4->已关闭；5->无效订单")
    private Integer status;

    @Note("退款状态，枚举值：1：无售后或售后关闭，2：售后处理中，3：退款中，4： 退款成功")
    private Integer aftersaleStatus;

    @Note("物流公司(配送方式)")
    private String deliveryCompany;

    @Note("物流单号")
    private String deliverySn;

    @Note("自动确认时间（天）")
    private Integer autoConfirmDay;

    @Note("收货人姓名")
    private String receiverName;

    @Note("收货人电话")
    private String receiverPhone;

    @Note("加密的手机号")
    private String receiverPhoneEncrypted;

    @Note("收货人邮编")
    private String receiverPostCode;

    @Note("省份/直辖市")
    private String receiverProvince;

    @Note("城市")
    private String receiverCity;

    @Note("区")
    private String receiverDistrict;

    @Note("省份/直辖市id")
    private Long receiverProvinceId;

    @Note("城市id")
    private Long receiverCityId;

    @Note("区id")
    private Long receiverDistrictId;

    @Note("详细地址")
    private String receiverDetailAddress;

    @Note("订单备注")
    private String note;

    @Note("商家备注")
    private String merchantNote;

    @Note("确认收货状态：0->未确认；1->已确认")
    private Integer confirmStatus;

    @Note("删除状态：0->未删除；1->已删除")
    private Integer deleteStatus;

    @Note("支付时间")
    private LocalDateTime paymentTime;

    @Note("发货时间")
    private LocalDateTime deliveryTime;

    @Note("确认收货时间")
    private LocalDateTime receiveTime;

    @Note("优惠券ID")
    private Long memberCouponId;

    @Note("优惠券金额")
    private BigDecimal couponAmount;

}
